﻿using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;

namespace HelenServer.Migrator;

[Table("zt_bug")]
[Index("AssignedTo", Name = "assignedTo")]
[Index("Case", Name = "case")]
[Index("Product", Name = "product")]
[Index("Status", Name = "status")]
public partial class ZtBug
{
    [Key]
    [Column("id", TypeName = "mediumint(8)")]
    public int Id { get; set; }

    [Column("product", TypeName = "mediumint(8) unsigned")]
    public uint Product { get; set; }

    [Column("module", TypeName = "mediumint(8) unsigned")]
    public uint Module { get; set; }

    [Column("toStory", TypeName = "mediumint(8)")]
    public int ToStory { get; set; }

    [Column("title")]
    [StringLength(255)]
    public string Title { get; set; } = null!;

    [Column("keywords")]
    [StringLength(255)]
    public string Keywords { get; set; } = null!;

    [Column("severity", TypeName = "tinyint(4)")]
    public sbyte Severity { get; set; }

    [Column("pri", TypeName = "tinyint(3) unsigned")]
    public byte Pri { get; set; }

    [Column("type")]
    [StringLength(30)]
    public string Type { get; set; } = null!;

    [Column("os")]
    [StringLength(30)]
    public string Os { get; set; } = null!;

    [Column("browser")]
    [StringLength(30)]
    public string Browser { get; set; } = null!;

    [Column("steps", TypeName = "text")]
    public string Steps { get; set; } = null!;

    [Column("status", TypeName = "enum('active','resolved','closed')")]
    public string Status { get; set; } = null!;

    [Column("confirmed")]
    public bool Confirmed { get; set; }

    [Column("activatedCount", TypeName = "smallint(6)")]
    public short ActivatedCount { get; set; }

    [Column("activatedDate", TypeName = "datetime")]
    public DateTime ActivatedDate { get; set; }

    [Column("mailto", TypeName = "text")]
    public string? Mailto { get; set; }

    [Column("openedBy")]
    [StringLength(30)]
    public string OpenedBy { get; set; } = null!;

    [Column("openedDate", TypeName = "datetime")]
    public DateTime OpenedDate { get; set; }

    [Column("openedBuild")]
    [StringLength(255)]
    public string OpenedBuild { get; set; } = null!;

    [Column("assignedTo")]
    [StringLength(30)]
    public string AssignedTo { get; set; } = null!;

    [Column("assignedDate", TypeName = "datetime")]
    public DateTime AssignedDate { get; set; }

    [Column("deadline")]
    public DateOnly Deadline { get; set; }

    [Column("resolvedBy")]
    [StringLength(30)]
    public string ResolvedBy { get; set; } = null!;

    [Column("resolution")]
    [StringLength(30)]
    public string Resolution { get; set; } = null!;

    [Column("resolvedBuild")]
    [StringLength(30)]
    public string ResolvedBuild { get; set; } = null!;

    [Column("resolvedDate", TypeName = "datetime")]
    public DateTime ResolvedDate { get; set; }

    [Column("closedBy")]
    [StringLength(30)]
    public string ClosedBy { get; set; } = null!;

    [Column("closedDate", TypeName = "datetime")]
    public DateTime ClosedDate { get; set; }

    [Column("duplicateBug", TypeName = "mediumint(8) unsigned")]
    public uint DuplicateBug { get; set; }

    [Column("linkBug")]
    [StringLength(255)]
    public string LinkBug { get; set; } = null!;

    [Column("case", TypeName = "mediumint(8) unsigned")]
    public uint Case { get; set; }

    [Column("lastEditedBy")]
    [StringLength(30)]
    public string LastEditedBy { get; set; } = null!;

    [Column("lastEditedDate", TypeName = "datetime")]
    public DateTime LastEditedDate { get; set; }

    [Column("deleted", TypeName = "enum('0','1')")]
    public string Deleted { get; set; } = null!;
}